Network management work is generally classified into three types: operation, administration, and maintenance, which are OAM for short.
Main functions of the OAM may include OAM capability negotiation between two parties of a session, link connectivity monitoring and path tracking, fault indication, a loopback test, detection on performance such as a delay and a packet loss rate, and the like.
An OAM packet is generally transferred using a special Ethernet type and a special destination Media Access Control (MAC) address or port, so as to implement OAM detection. For example, using Ethernet OAM technologies, administration and maintenance capabilities for the Ethernet can be efficiently improved, and stable running of a network can be ensured. The Ethernet OAM technologies are implemented level by level, and are classified into the following two levels: a link-level Ethernet OAM technology and a network-level Ethernet OAM technology.
The link-level Ethernet OAM technology is mainly applied to monitoring a status of a link between a user network and an operator network. A typical protocol is the Ethernet in the First Mile OAM (EFM OAM) protocol.
Meanings of important fields in an EFM OAM packet are shown in the following table 1.
TABLE 1FieldMeaningDestination (Dest)Destination MAC address, which is a slow protocolAddress (addr)multicast address: 0x0180-C200-0002Source addrSource MAC address, which is a MAC address of aninterface at a transmit endTypeEthernet protocol type, which is 0x8809
It may be learned that a special destination Media Access Control (MAC) address and a specified Ethernet protocol type (EtherType) are used in the EFM OAM packet.
The network-level Ethernet OAM technology is mainly applied at an access layer and a convergence layer that are of a network, and is used to monitor connectivity of the entire network and locate a connectivity fault of the network. A typical protocol is the connectivity fault management (CFM) protocol.
Meanings of important fields in a CFM OAM packet are shown in the following table 2.
TABLE 2FieldMeaningDest MACDestination MAC addressSrc MACSource MAC addressEtherTypeEthernet protocol type, which is 0x8902
It may be learned from the foregoing table that a specified Ethernet protocol type is used in the CFM OAM packet.
For another example, bidirectional forwarding detection (BFD) is used for packet transfer based on the User datagram protocol (UDP), and a special destination port number is used in an OAM packet of the BFD to implement OAM detection. A special EtherType and a special destination MAC address were used in an EFM OAM packet, a special EtherType is used in a CFM OAM packet, and a special destination port number is used in a BFD packet, which means that the ETH OAM packet and a service packet have different EtherType and destination MAC addresses, the CFM OAM packet and the service packet have different EtherType, and the BFD packet and the service packet have different destination port numbers. If a network device includes a forwarding entry that matches EtherType, destination MAC address, or a destination port number of the service packet, the service packet matches a corresponding forwarding entry, but the OAM packet does not match a corresponding forwarding entry. That is, for an OAM packet in a traditional network, a routing switch subunit is bypassed in the network device, and different forwarding entries are used in a service path. Therefore, a complete forwarding path consistent with a traffic flow cannot be detected. For example, OPENFLOW is used as a protocol for implementing software-defined networking (SDN), and separation of a data forwarding layer from a control layer is implemented on an OPENFLOW network. An OPENFLOW switch is mainly responsible for data forwarding: after receiving a data packet, the OPENFLOW switch performs matching on a flow table entry in a flow table, where the flow table entry is used to indicate a method for processing the data packet by the switch, and forwards the data packet according to a matched flow table entry. If the OPENFLOW switch includes flow table entries that match EtherType and destination MAC address that are of a service packet, the service packet matches a corresponding flow table entry, but an OAM packet does not match the corresponding flow table entry. That is, different flow table entries are used in the OAM packet and the service packet. Therefore, a complete forwarding path consistent with a traffic flow cannot be detected. The OPENFLOW switch has multiple matching fields that can be flexibly combined, thereby causing a higher probability of this problem.
If a traffic flow is a packet at an Internet Protocol (IP) layer or a level upper than IP layer, when an error occurs in a single forwarding entry (which, for example, matches a service packet whose port number is 8080 in the Transmission Control Protocol (TCP) protocol, to forward the service packet to a specific path) on the network device, and another forwarding entry and other software and hardware subunits function properly, a fault occurs in the service packet related to the forwarding entry. Because a forwarding entry that matches an OAM packet is different from a forwarding entry that matches the service packet, a fault may not occur in the OAM packet, and this type of fault cannot be detected using an OAM method in the prior art.